package cn.itsource.ymcc.feign.fallback;

import cn.itsource.ymcc.feign.MediaFeign;
import cn.itsource.ymcc.result.JsonResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MediaFeignFallbackFactory implements FallbackFactory<MediaFeign> {
    @Override
    public MediaFeign create(Throwable throwable) {
        return new MediaFeign() {
            @Override
            public JsonResult selectByCourseId(Long courseId) {
                return JsonResult.error("获取视频失败");
            }
        };
    }
}
